﻿$(function () {
    $('body').delegate('.goods-li img','mouseover',function () {
        $(this).stop(true).animate({
            width: '220px',
            height: '220px',
            left: '-10px',
            top: '-15px'
        }, 200)
    })
    $('body').delegate('.goods-li img', 'mouseout', function () {
        $(this).animate({
            width: '138px',
            height: '138px',
            left: '0px',
            top: '0px'
        })
    })
    $('.market-header .type-item').click(function () {
        $('.market-header .type-item').removeClass('active');
        $(this).addClass('active');
        $('span.add').html($(this).attr('name')).addClass('iconfont icon-you');
        $.ajax({
            url: "../Store/GoodsClassificationPatialView",
            type: "get",
            data: {
                type: $(this).attr('value'),
                name: $('.search-wrapper .i_Text').val()
            },
            success: function (data) {
                $('.goods-container').html(data)
            }
        })
    })
    $('.goods-header ul li').click(function () {
        if ($('.market-header .type-item.active').attr('value') == null) t = 0;
        else t = $('.market-header .type-item.active').attr('value');
        $('.goods-header ul li').removeClass('on');
        $(this).addClass('on');
        $.ajax({
            url: "../Store/GoodsClassificationPatialView",
            type: "get",
            data: {
                type: t,
                name: $('.search-wrapper .i_Text').val(),
                orderType: $(this).val()
            },
            success: function (data) {
                $('.goods-container').html(data)
            }
        })
    })
})